<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Commission
 *
 * @property int $id
 * @property int|null $from_member 产生用户id
 * @property int|null $to_member 受益用户id
 * @property float|null $price 金额
 * @property int|null $type 1.推广人返利2.团队管理提成.8.推广奖励
 * @property string|null $desc
 * @property \Carbon\Carbon|null $created_at
 * @property \Carbon\Carbon|null $updated_at
 * @property-read \App\Http\Controllers\Admin\Member\Repository\Member $fromMember
 * @property-read \App\Http\Controllers\Admin\Member\Repository\Member|null $member
 * @property-read \App\Http\Controllers\Admin\Member\Repository\Member $toMember
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Commission whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Commission whereDesc($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Commission whereFromMember($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Commission whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Commission wherePrice($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Commission whereToMember($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Commission whereType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Commission whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class Commission extends Model
{

    protected $table = 'commission';
    public function fromMember(){
        return $this->belongsTo('App\Http\Controllers\Admin\Member\Repository\Member','member_id');
    }
    public function toMember(){
        return $this->belongsTo('App\Http\Controllers\Admin\Member\Repository\Member','member_id');
    }
    public function member(){
        return $this->belongsTo('App\Http\Controllers\Admin\Member\Repository\Member','from_member');
    }
}
